import {createAsyncThunk,createSlice} from '@reduxjs/toolkit'
import * as services from 'services/Consultationinformation/Interviewchathistory'
import { addBuilder } from 'store/dict'

export const dointerviewchathistory = createAsyncThunk<any,any>(
    'Interviewchathistory/dointerviewchathistory',
    async(data)=>{
        console.log(data)
        const res  = await services.interviewchathistory(data.count,data.page,data.count)
        return res
    }
)

const initialState = {
    // Interviewchathistory:{}
}

const Interviewchathistory = createSlice({
    name:'Interviewchathistory',
    initialState,
    reducers:{},
    extraReducers:(builder) =>{
        addBuilder(builder,dointerviewchathistory,(state,action)=>{
            console.log(action);
            const {result} = action.payload
            state.Interviewchathistory = result
        })
    }
})

export default Interviewchathistory.reducer
export const InterviewchathistoryServer = (state:any) =>{
    return state.Interviewchathistory.Interviewchathistory
}